package com.tree.springboot.service;

import com.tree.dubbo.api.DemoService;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Value;

/**
 * @ClassName com.tree.springboot.service
 * Description: <类功能描述>. <br>
 * <p>
 * 注意， 这里的@Service是dubbo的service，而不是spring的
 * </p>
 * @Author tree
 * @Date 2019-08-25 23:08
 * @Version 1.0
 */
@Service(version = "${demo.service.version}")
public class DefaultDemoService implements DemoService {
    /**
     * The default value of ${dubbo.application.name} is ${spring.application.name}
     */
    @Value("${dubbo.application.name}")
    private String serviceName;

    @Override
    public String sayHello(String name) {
        System.out.println(String.format("[%s] : Hello, %s", serviceName, name));
       return String.format("[%s] : Hello, %s", serviceName, name);
    }
}
